package com.woniuxy.commons.factory;

import com.woniuxy.commons.dto.LearnMapDetailDto;
import com.woniuxy.commons.dto.LearnMapDto;
import com.woniuxy.commons.dto.RouteDetailDto;
import com.woniuxy.commons.entity.LearnMap;
import com.woniuxy.commons.entity.PageBean;
import com.woniuxy.commons.entity.ResponseEntity;
import com.woniuxy.commons.entity.Route;
import com.woniuxy.commons.service.RemoteExamService;
import com.woniuxy.commons.service.RemoteLearnMapService;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.List;

/**
 * @author 吴毛伟
 * @date:2020/7/30 20:25
 * @description:
 */
@Component
public class RemoteLearnMapServiceFactory implements FallbackFactory<RemoteLearnMapService> {
    @Override
    public RemoteLearnMapService create(Throwable throwable) {
        return new RemoteLearnMapService() {
            @Override
            public ResponseEntity<PageBean<LearnMapDto>> findLearnMapsByPage(LearnMapDto learnMapDto) {
                ResponseEntity<PageBean<LearnMapDto>> responseEntity = new ResponseEntity<>();
                return responseEntity.setMessage("错误啦");
            }

            @Override
            public ResponseEntity<List<LearnMapDetailDto>> findLearnMapDetailsByLmid(LearnMap learnMap) {
                ResponseEntity<List<LearnMapDetailDto>> responseEntity = new ResponseEntity<>();
                return responseEntity.setMessage("错误啦");
            }


            @Override
            public ResponseEntity<List<RouteDetailDto>> findRouteDetailsByRouteId(Route route) {
                ResponseEntity<List<RouteDetailDto>> responseEntity = new ResponseEntity<>();
                return responseEntity.setMessage("错误啦");
            }
        };
    }
}
